package cn.domain;

import cn.config.JavaConfig;
import cn.domain.Stu;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@Slf4j
public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(JavaConfig.class);
        Stu stu=ctx.getBean(Stu.class);
        log.debug("spring创建的bean {}",stu);
       // Stu stu2=ctx.getBean("stu",Stu.class);
        Stu stu2=ctx.getBean("jee-stu",Stu.class);
        log.info("通过名字得到bean {}",stu2);
        Clazz clazz=ctx.getBean(Clazz.class);
        log.info("类间关系 {}",clazz);
    }
}
